package com.example.thai.mydemo2.SqlAdapter;

import android.content.ContentValues;

/**
 * Created by thai on 2014/10/30.
 * 參考用
 */
public class User {
    private int id;
    private String reataurant;
    private String name;
    private int money;
    private byte[] image;

    public User() {
        super();
    }

    public User(int id, String name, int money) {
        super();
        this.id = id;
        this.name = name;
        this.money = money;
    }

    //
    // public User(int id, String name, int money, byte[] image) {
    // super();
    // this.id = id;
    // this.name = name;
    // this.money = money;
    // this.image = image;
    // }

    public User(int id, String reataurant, String name, int money, byte[] image) {
        super();
        this.id = id;
        this.name = name;
        this.reataurant = reataurant;
        this.money = money;
        this.image = image;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getRestaurant() {
        return reataurant;
    }

    public void setReataurant() {
        this.reataurant = reataurant;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public byte[] getImage() {
        return image;
    }

    public void setImage(byte[] image) {
        this.image = image;
    }

    @Override
    public String toString() {
        // TODO Auto-generated method stub
        return String.format("%d :-- %s , " + "金額: " + "%s", id, name, money);
    }

    public ContentValues toContentValues() {
        ContentValues data = new ContentValues();
//		data.put("ID", this.id);// 這個不需要，因為database會自動建立
        data.put("RESTAURANT", this.reataurant);
        data.put("NAME", this.name);
        data.put("MONEY", this.money);
        data.put("IMAGE", this.image);
        return data;
    }

}
